package com.erli.exchange.service.impl;

import java.util.List;

import com.erli.exchange.service.BaseService;
import com.erli.exchange.core.beans.entity.BaseEntity;
import com.erli.exchange.dao.BaseDao;

import tk.mybatis.mapper.entity.Example;

public abstract class BaseServiceImpl<Record extends BaseEntity> implements BaseService<Record> {

	public abstract BaseDao<Record> getBaseDao();

	@Override
	public Integer insert(Record record) {
		return getBaseDao().insert(record);
	}
	
	@Override
	public Integer insertSelective(Record record) {
		return getBaseDao().insertSelective(record);
	}

	@Override
	public Integer updateById(Record record) {
		return getBaseDao().updateById(record);
	}

	@Override
	public Integer updateByColumn(String column, Object value, Record record) {
		return getBaseDao().updateByColumn(column, value, record);
	}

	@Override
	public Integer updateByExampleSelective(Record record, Example example) {
		return getBaseDao().updateByExampleSelective(record, example);
	}

	@Override
	public Integer deleteById(Integer id) {
		return getBaseDao().deleteById(id);
	}

	@Override
	public Integer deleteByColumn(String column, Object value) {
		return getBaseDao().deleteByColumn(column, value);
	}

	@Override
	public Integer deleteByRecord(Record record) {
		return getBaseDao().deleteByRecord(record);
	}

	@Override
	public Integer deleteByExample(Example example) {
		return getBaseDao().deleteByExample(example);
	}

	@Override
	public Record findById(Integer id) {
		return getBaseDao().findById(id);
	}

	@Override
	public Record findByColumn(String column, Object value) {
		return getBaseDao().findByColumn(column, value);
	}

	@Override
	public Record findByRecord(Record record) {
		return getBaseDao().findByRecord(record);
	}

	@Override
	public List<Record> findListByColumn(String column, Object value) {
		return getBaseDao().findListByColumn(column, value);
	}

	@Override
	public List<Record> findListByRecord(Record record) {
		return findListByRecord(record, null);
	}

	@Override
	public List<Record> findListByRecord(Record record, String orderByClause) {
		return getBaseDao().findListByRecord(record, orderByClause);
	}

	@Override
	public Record findByExample(Example example) {
		return getBaseDao().findByExample(example);
	}

	@Override
	public List<Record> findListByExample(Example example) {
		return getBaseDao().findListByExample(example);
	}

	@Override
	public Integer countByRecord(Record record) {
		return getBaseDao().countByRecord(record);
	}

	@Override
	public Integer countByExample(Example example) {
		return getBaseDao().countByExample(example);
	}
}
